www.gusucode.com > 深度学习(asp)网址导航 v4.0.1 > 深度学习(asp)网址导航 v4.0.1\code\js\siteState.asp

    <%'@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
projectRootPath = "../"	'相对当前应用程序根的位置
%>
<!--#include file="../ConnDB.asp"-->
<%
'统计
sql= "Select count(*) from deep_WebSort"
Set rsWebSortCount=conn.execute(sql)

sql="Select count(*)  from deep_WebUrl where fpassed=1"
Set rsWebUrlCount=conn.execute(sql)
	Response.Write("document.write('&nbsp; &nbsp; &nbsp; &#8226; &nbsp; 网址分类: <font color=\'#FF0000\'>"&rsWebSortCount(0)&"</font> 个<br />');")
	Response.Write("document.write('&nbsp; &nbsp; &nbsp; &#8226; &nbsp; 网站总数: <font color=\'#FF0000\'>"&rsWebUrlCount(0)&"</font> 个<br />');")
	Response.Write("document.write('&nbsp; &nbsp; &nbsp; &#8226; &nbsp; 当前在线: <font color=\'#FF0000\'>"&onlineCount()&"</font> 人');")
rsWebSortCount.close 
Set rsWebSortCount = Nothing
rsWebUrlCount.close 
Set rsWebUrlCount = Nothing
'统计结束

Call CloseConnDB()

'┌──────────────────── 深度空间 深度学习 ──┐
'│函数名:OnlineCount
'│作  用:在线人数统计
'│参  数:
'│返回值:
'│日  期:2006/7/18
'└──────────────────── www.DeepTeach.com ──┘
function onlineCount()
	t=(cint(day(date()))*24+cint(hour(time())))*60+cint(minute(time())) 
	k=0 
	i=1 
	y=0 
	Do While application("OnlineIP"&i)<>"" 
		if application("OnlineIP"&i)=Request.ServerVariables("REMOTE_ADDR") then 
			application("OnlineData"&i)=t 
			y=1 
		end if 
		if t-application("OnlineData"&i)>9 or t<application("OnlineData"&i) then 
			k=k+1 
		else 
			if k>0 then 
				application.lock 
				application("OnlineIP"&i-k)=application("OnlineIP"&i) 
				application("OnlineData"&i-k)=application("OnlineData"&i) 
				application.unlock 
			end if 
		end if 
		if k>0 then 
			application.lock 
			application("OnlineIP"&i)="" 
			application.unlock 
		end if 
		i=i+1 
	loop 
	if y=0 then 
		application("OnlineIP"&i)=Request.ServerVariables("REMOTE_ADDR") 
		application("OnlineData"&i)=t 
	else 
		i=i-1 
	end if 
	
	onlineCount=i
end function
%>